package com.transsion.clouddemo.core.Custom

import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.transsion.clouddemo.core.DataGenerator

abstract class BasePagerAdapter(activity: AppCompatActivity) : FragmentStateAdapter(activity) {


    abstract val PAGE_INDEX: Int


    override fun getItemCount(): Int {
        return DataGenerator.getFragments(PAGE_INDEX).size
    }

    override fun createFragment(position: Int): Fragment {
        return DataGenerator.getFragments(PAGE_INDEX)[position]
    }

}
